﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.CUiDisShortestPathCmd
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using EngineeringInternalExtension;
using System.Resources;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands;

public class CUiDisShortestPathCmd : TxButtonCommand
{
  private CUiDisAutomaticDisassemblyEnabler m_commandEnabler;
  private const string RESOURCE_TABLE_PATH = "DnProcessSimulateCommands.AutomaticDisassembly.ResourceTable";
  private const string COMMAND_BITMAP_PATH = "AutomaticDisassembly.shortestPathCommand.bmp";
  private ResourceManager m_resourceMgr;

  public CUiDisShortestPathCmd()
  {
    this.m_commandEnabler = new CUiDisAutomaticDisassemblyEnabler();
    this.m_resourceMgr = this.GetResourceManger();
  }

  public virtual void Execute(object cmdParams)
  {
    if (!TxCommandLicenser.AutomaticDysassemblyLicense)
    {
      TxMessageBoxEx.ShowNoLicenseError(base.Name);
    }
    else
    {
      if (!CUiDisAutomaticDisassemblyEnabler.AreCommandConditionsMet())
        return;
      new CUiDisAutomaticDisassemblyForm(CUiDisAutomaticDisassemblyForm.SequenceGenerationMode.ShortestPath).Show(CUiDisAutomaticDisassemblyEnabler.GetSelectedOperation());
    }
  }

  public virtual bool Connect() => true;

  private ResourceManager GetResourceManger()
  {
    return new ResourceManager("DnProcessSimulateCommands.AutomaticDisassembly.ResourceTable", ((object) this).GetType().Assembly);
  }

  public virtual string Bitmap => "AutomaticDisassembly.shortestPathCommand.bmp";

  public virtual string Description
  {
    get => this.m_resourceMgr.GetString("SHORTEST_PATH_SEQUENCE_CMD_DESCRIPTION");
  }

  public virtual ITxCommandEnabler CommandEnabler => (ITxCommandEnabler) this.m_commandEnabler;

  public virtual string Name => this.m_resourceMgr.GetString("SHORTEST_PATH_SEQUENCE_CMD_NAME");

  public virtual string Tooltip
  {
    get => this.m_resourceMgr.GetString("SHORTEST_PATH_SEQUENCE_CMD_TOOLTIP");
  }

  public virtual string Category
  {
    get => this.m_resourceMgr.GetString("SHORTEST_PATH_SEQUENCE_CMD_CATEGORY");
  }
}
